package com.yexiong.server.dao.impl;


import java.util.List;

import com.common.entity.Event;
import com.common.entity.Payment;
import com.yexiong.dao.IEventDao;
import com.yexiong.dao.impl.EventDaoImpl;
import com.yexiong.server.dao.IEventServer;

import utils.Page;

public class EventServerImpl implements IEventServer{
	private IEventDao IEventDao=new EventDaoImpl();

	@Override
	public Page<Event> getPage(String condition, int currentPage, int pageSize, String startTime, String endTime) {
		int count=IEventDao.getCount(startTime,endTime,condition);
		List<Event> list=IEventDao.getOnePageInfo(condition, currentPage, pageSize,startTime,endTime);
		return new Page<>(currentPage, count, pageSize, list);
	}

	@Override
	public int insert(Event payment) {
		int result=0;
		result=IEventDao.insert(payment);
		return result;
	}

	@Override
	public int delete(String id) {
		int result=0;
		result=IEventDao.deleteByDate(id);
		return result;
	}

	@Override
	public int update(Event event) {
		return IEventDao.update(event);
	}

	@Override
	public int getIdByDate(String date) {
		return IEventDao.getIdByDate(date);
	}

	@Override
	public int check(Event event) {
		return IEventDao.check(event);
	}

}
